<template>
  <div class="home">
    home的子路由
    <div v-permission="'adminA'">自定义指令</div>
    <van-button type="primary" @click="logout()">退出登录</van-button>
    <van-field v-model="inputTest.input" label="文本" placeholder="请输入用户名" />
  </div>
</template>

<script setup lang="ts" name="Home">
import {useUserStore} from "@/store/modules/user.ts";
import {reactive} from "vue";
const userStore = useUserStore();

const inputTest = reactive<{
  input: string
}>({
  input: ''
})

// 退出登录
function logout() {
  userStore.logout();
}
</script>

<style scoped lang="less">
.home{
  height: 100px;
  background: red;
}
</style>